<?php
//
// +------------------------------------------------------------------------+
// | PHP Version 5.4                                                        |
// +------------------------------------------------------------------------+
// | Copyright (c) All rights reserved.                                     |
// +------------------------------------------------------------------------+
// | 世纪车来车往(北京）网络科技有限公司 版权所有！                                 |
// | TEL:010-63732365  HOTLINE:400-6688-365  EMAIL:clcw@clcw.com.cn         |
// | $Revision: 1.0 $                                                       |
// +------------------------------------------------------------------------+
// | Author: xiangminghu@clcw.com.cn                                        |
// +------------------------------------------------------------------------+
//
namespace AuctionBack\Controller;

use AuctionCore\Common\AjaxPage;

class ReportAnswerController extends BaseController
{
    private $questionAnswerLogic;

    public function __construct()
    {
        parent::__construct();

        $this->questionAnswerLogic = D('QuestionAnswer', 'Logic');
    }

    public function index()
    {
        $uid = I('get.uid/d', 0);
        $this->assign('uid', $uid);
        $this->display();
    }

    /**
     *　回答举报管理列表
     */
    public function reportAnswerList()
    {
        $page = I("get.p", 1);
        $size = 10;
        $params = [];
        $params['uid'] = I('get.uid/d', 0);
        $params['a_id'] = I('get.a_id/d', 0);
        $params['a_keywords'] = I('get.a_keywords', '');
        $params['a_uid'] = I('get.a_uid/d', 0);
        $params['a_user_name'] = I('get.a_user_name', '', 'trim');
        $params['a_status'] = I('get.a_status/d', 0);
        $params['start_time'] = I('get.start_time', '');
        $params['end_time'] = I('get.end_time', '');
        $result = $this->questionAnswerLogic->getReportAnswerList($page, $size, $params);
        $list = !empty($result['list']) ? $result['list'] : [];
        $Page = new AjaxPage($result['total'], $size, "get_page");
        $Page->setConfig('theme', " %totalRow% %header% %nowPage%/%totalPage% 页 %first% %upPage% %prePage% %linkPage% %nextPage% %downPage%  %end% %jumpform%");
        $show = $Page->show();          // 分页显示输出
        $this->assign('page', $show);   // 赋值分页输出l
        $this->assign('list', $list);
        $this->assign('p', $page);
        $this->assign('total', $result['total']);
        $this->assign('params', $params);
        $this->display();
    }
}